home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 …ember: Reference Library / Apple Developer Reference Library (December 1999) (Disk 1).iso / pc / technical documentation / develop / develop issue 29 / develop issue 29 code / newton web server / personal translator / install &c < prev    next >
Encoding:
Text File  |  1996-10-20  |  1.4 KB  |  51 lines

  1. /*
  2.  © 1996 Ray Rischpater
  3.  All Rights Reserved.
  4.  dove@lothlorien.com
  5.  This program is free software; you can redistribute it and/or
  6.  modify it under the terms of the GNU General Public License 
  7.  as published by the Free Software Foundation; either 
  8.  version 2 of the License, or (at your option) any later 
  9.  version.
  10.  
  11.  This program is distributed in the hope that it will be useful,
  12.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14.  GNU General Public License for more details.
  15.  You should have received a copy of the GNU General Public 
  16.  License along with this program; if not, write to the Free 
  17.  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 
  18.  USA. 
  19.  
  20. */
  21.  
  22.  InstallScript:=func(inPartFr, inFrameFr)
  23.  begin
  24.      if HasSlot(GetRoot(),'|nHTTPd:ALLPEN|) then
  25.      begin
  26.          GetRoot().|nHTTPd:ALLPEN|:RegTranslator(kAppSymbol,
  27.              "/personal/",
  28.              {
  29.                  _parent: nil,
  30.                  CompletionScript: func(inEp, inData, inErr)
  31.                  begin
  32.                      PlaySoundSync(ROM_funbeep);
  33.                     inEp:Output("Plink!" & unicodeLF , nil, nil);
  34.                     inEp:Close();
  35.                 end,
  36.              });
  37.      end
  38.      else
  39.      begin
  40.          GetRoot():Notify(kNotifyAlert, "Personal Server",
  41.              "nHTTPd is not currently installed.");
  42.      end
  43.  end;
  44.  
  45.  RemoveScript:=func(inPartFr)
  46.  begin
  47.       if HasSlot(GetRoot(),'|nHTTPd:ALLPEN|) then
  48.      begin
  49.          GetRoot().|nHTTPd:ALLPEN|:UnRegTranslators(kAppSymbol);
  50.      end
  51.  end;